package com.example.dayu521.msg_sender.service.fengin;

import com.example.dayu521.msg_sender.controller.SeckillSessionController;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.Date;

//https://github.com/alibaba/spring-cloud-alibaba/wiki/Sentinel#feign-%E6%94%AF%E6%8C%81
@FeignClient(name="${alias.feign.msg-sender}",fallback = Ks.class ,configuration = Ks.class)
public interface MyselfFC {
    @GetMapping("/msg_sender/seckillSession/hello")
    SeckillSessionController.Tx hello();
}

class Ks implements  MyselfFC{

    @Override
    public SeckillSessionController.Tx hello() {
        return new SeckillSessionController.Tx(new Date(),"hello失败了");
    }
}
